package com.jack.helloworld.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.jack.helloworld.R;
import com.jack.helloworld.activity.mode.BaseActivity;

public class Main04Activity extends BaseActivity implements View.OnClickListener {

    Button btnSharePreference;
    Button btnFile;
    Button btnContentProvider;
    Button btnService;
    Button btnSystemService;
    Button btnGestureDetector;
    Button btnGestureOverlayView;
    Button btnRunningAppInfo;
    Button btnGetAccount;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main04);

        initView();
        initData();
    }

    protected void initView() {
        btnSharePreference = (Button) findViewById(R.id.btnSharePreference);
        btnFile = (Button) findViewById(R.id.btnFile);
        btnContentProvider = (Button) findViewById(R.id.btnContentProvider);
        btnService = (Button) findViewById(R.id.btnService);
        btnSystemService = (Button) findViewById(R.id.btnSystemService);
        btnGestureDetector = (Button) findViewById(R.id.btnGestureDetector);
        btnGestureOverlayView = (Button) findViewById(R.id.btnGestureOverlayView);
        btnRunningAppInfo = (Button) findViewById(R.id.btnRunningAppInfo);
        btnGetAccount = (Button) findViewById(R.id.btnGetAccount);
    }

    protected void initData() {
        btnSharePreference.setOnClickListener(this);
        btnFile.setOnClickListener(this);
        btnContentProvider.setOnClickListener(this);
        btnService.setOnClickListener(this);
        btnSystemService.setOnClickListener(this);
        btnGestureDetector.setOnClickListener(this);
        btnGestureOverlayView.setOnClickListener(this);
        btnRunningAppInfo.setOnClickListener(this);
        btnGetAccount.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btnSharePreference:
                Intent intent = new Intent(this, SharePreferenceActivity.class);
                startActivity(intent);
                break;
            case R.id.btnFile:
                intent = new Intent(this, FileActivity.class);
                startActivity(intent);
                break;
            case R.id.btnContentProvider:
                intent = new Intent(this, ContentProviderActivity.class);
                startActivity(intent);
                break;
            case R.id.btnService:
                intent = new Intent(this, ServiceActivity.class);
                startActivity(intent);
                break;
            case R.id.btnSystemService:
                intent = new Intent(this, SystemServiceActivity.class);
                startActivity(intent);
                break;
            case R.id.btnGestureDetector:
                intent = new Intent(this, GestureDetectorActivity.class);
                startActivity(intent);
                break;
            case R.id.btnGestureOverlayView:
                intent = new Intent(this, GestureOverlayViewActivity.class);
                startActivity(intent);
                break;
            case R.id.btnRunningAppInfo:
                intent = new Intent(this, RunningAppInfoActivity.class);
                startActivity(intent);
                break;
            case R.id.btnGetAccount:
                intent = new Intent(this, GetAccountActivity.class);
                startActivity(intent);
                break;
        }
    }
}
